package io.xxx.xbutler.domain;

import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.handlers.Fastjson2TypeHandler;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.ibatis.type.EnumTypeHandler;

import java.time.LocalDateTime;

@Data
@Accessors(chain = true)
public class ExportTask {

    @TableId
    private Long id;

    private String name;

    @TableField(typeHandler = EnumTypeHandler.class)
    private ExportTaskType type;

    @TableField(typeHandler = Fastjson2TypeHandler.class)
    private JSONObject params;

    private String ossPath;

    @TableField(typeHandler = EnumTypeHandler.class)
    private ExportTaskStatus status;

    private LocalDateTime startTime;

    private LocalDateTime endTime;

    private Double spentTime;

    private Integer count;

    private Double progress;

    private String exception;

    /**
     * 临时文件是否已经清理
     */
    private Boolean cleaned;

    private Long createdId;

    private String createdName;

    private LocalDateTime createdTime;

    private Long updatedId;

    private String updatedName;

    private LocalDateTime updatedTime;
}
